package com.example.myapplication.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomSheetDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.View;


import com.example.myapplication.R;

/**
 *
 * Created by Lx on 2018/9/27.
 */

public class BottomSheetBehaviorDemo extends AppCompatActivity implements View.OnClickListener {
    BottomSheetDialog bottomSheetDialog;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bottomsheetdemo);
        findViewById(R.id.bottomdemo_btn).setOnClickListener(this);
        initDialog();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.bottomdemo_btn:

                bottomSheetDialog.show();
                break;
        }
    }
    private void initDialog() {
        bottomSheetDialog = new BottomSheetDialog(this);
        bottomSheetDialog.setContentView(R.layout.dialog_goods_sku_layout);
        bottomSheetDialog.getDelegate().findViewById(android.support.design.R.id.design_bottom_sheet)
                .setBackgroundColor(getResources().getColor(android.R.color.transparent));


    }


}
